﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using SalePartial.Utility;
using System.Web.Security;
using SalePartial.BLL;
using XunPan.Web.Globals;
using SalePartial.Model;
using System.Data.SqlClient;

public partial class Trade_Events_event_list : System.Web.UI.Page
{
    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["s_userID_guid"] == null || Session["s_companyID_guid"] == null)
                {
                    bool result = UserBLL.StoreUserInfoToSession(User.Identity.Name);
                }

                sdsEventsList.SelectParameters["VendorCompanyID"].DefaultValue = Session["s_companyID_guid"].ToString();
                sdsFilterList.SelectParameters["CompanyID"].DefaultValue = Session["s_companyID_guid"].ToString();

                XPInquiryFilter inqFilter = new XPInquiryFilter();
                inqFilter.updateXPFilterCnts(new Guid(Session["s_companyID_guid"].ToString()));
                InitializeEventRecordsOnMenuPanel();
        }
   }

 

    protected void radGridMainlist_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
    {

                    string read = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["EventStatus"].ToString().Substring(0, 1);
                    string eventid = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["EventID"].ToString();


                    HttpContext.Current.Session["EventID"] = eventid;
                    Response.Redirect(e.CommandArgument.ToString(), false);
                    e.Item.OwnerTableView.Rebind();

    }

    protected void rpbNavigator_ItemClick(object sender, Telerik.Web.UI.RadPanelBarEventArgs e)
    {
        if (e.Item.Items.Count > 0)
        {
            //主菜单框

        }
        else
        {
            //条目框
           
                radGridMainlist.Rebind();

            }
     

    }

    private void InitializeEventRecordsOnMenuPanel()
    {
        //    '初始化所有数据记录数
        string cmdtxt = sdsEventsList.SelectCommand;

        DataView dv = (DataView)sdsEventsList.Select(DataSourceSelectArguments.Empty);


    }





}